<?php
/**
 *
 * @author griever
 * @version
 */
require_once 'Zend/Loader/PluginLoader.php';
require_once 'Zend/Controller/Action/Helper/Abstract.php';
require_once 'Base.php';
require_once 'configs/Config.php';
require_once 'recaptchalib.php';

/**
 * CreateCaptcha Action Helper
 *
 * @uses actionHelper Custom_Helper
 */
class Custom_Helper_CreateCaptcha extends Dummy_Helper_Base
{
	public function createCaptcha()
	{
//		$recaptcha = new Zend_Service_ReCaptcha(ReCaptchaConfig::$pubKey, ReCaptchaConfig::$privKey);
//		$captcha = \$recaptcha->getHTML();
//		$captcha->setPrivkey();
//		$service = $captcha->getService();
//		$captcha = new Zend_Captcha_Image();
//		$captcha->getImgAlt();
//		$captcha->setWordlen(4)
//		->setTimeout('120')
//		->setFont(APPLICATION_PATH."/fonts/Aller_Rg.ttf")
//		->setImgDir(APPLICATION_PATH."/../imgdir")
//		->setImgUrl($this->getRootDir().'/imgdir');
//		$id = $captcha->generate();
		$recaptcha = recaptcha_get_html(ReCaptchaConfig::$pubKey, ReCaptchaConfig::$privKey);
//		$this->view->captcha = $recaptcha;
		return $recaptcha;
	}

	/**
	 * Strategy pattern: call helper as broker method
	 */
	public function direct(){
		// TODO Auto-generated 'direct' method
		return $this->createCaptcha();
	}
}

